CC=gcc
LIBS=
CFLAGS=-O2 -Wall -fPIC
INCLUDEPATH=-I. 
LDFLAGS= -shared
#OUTPUT_DIR=out
OUTPUT_NAME=libaes_dfa.so
TEST_NAME=test
OBJECTS=shift_row.o sbox.o matrix.o field.o mix_column.o \
	add_roundkey.o substitute.o
$(OUTPUT_NAME) : $(OBJECTS) $(OUTPUT_NAME_E)
	$(CC) -o $(OUTPUT_NAME) $(LIBS) $(LDFLAGS) $(OBJECTS)
shift_row.0 : shift_row.c types.h shift_row.h
	$(CC) -c $(CFLAGS) $(INCLUDEPATH) shift_row.c
sbox.o : sbox.c types.h sbox.h
	$(CC) -c $(CFLAGS) $(INCLUDEPATH) sbox.c
matrix.o : matrix.c matrix.h types.h
	$(CC) -c $(CFLAGS) $(INCLUDEPATH) matrix.c
field.o : field.c field.h types.h
	$(CC) -c $(CFLAGS) $(INCLUDEPATH) field.c
mix_column.o : mix_column.c mix_column.h matrix.h field.h types.h
	$(CC) -c $(CFLAGS) $(INCLUDEPATH) mix_column.c
add_roundkey.o : add_roundkey.c add_roundkey.h field.h types.h
	$(CC) -c $(CFLAGS) $(INCLUDEPATH) add_roundkey.c
substitute.o : substitute.c substitute.h sbox.h types.h
	$(CC) -c $(CFLAGS) $(INCLUDEPATH) substitute.c
$(TEST_NAME) : $(OUTPUT_NAME) test_main.c
	$(CC) $(INCLUDEPATH) $(CFLAGS) -o $(TEST_NAME) $(OUTPUT_NAME) test_main.c
clean : 
	-rm $(OBJECTS) $(OUTPUT_NAME) 
